package com.sjn.screen;
import com.sjn.Template.composingRoom;
import com.sjn.res.egBlueprint.bluePrintdata;
import com.sjn.res.egBlueprint.bluePrintdemo;
import com.sjn.res.egBlueprint.egbluePrintscreen;
import com.sjn.res.egFoundry.*;
import com.sjn.res.make.MakeFactory;
import com.sjn.res.make.Makescreen;
import com.sjn.res.make.Makesth;
import com.sjn.screen.Frame.Context;
import com.sjn.screen.Frame.Program1;
import com.sjn.screen.Frame.Program2;
import com.sjn.screen.Frame.Program3;
import com.sjn.util.encrytion.encryForblueprint;



public class ScreencomposingRoom extends composingRoom {
    //创建加密模块
    encryForblueprint encryForblueprint = new encryForblueprint();
    @Override
    public String Foundry(int i) {
        //开始选择代工厂
        if(i==1) {
            egFoundry egFoundry = Foundryitem.getscreenFoundry(new egFoundrySCREEN1());
            return egFoundry.getFoundryName();
        }
        else if(i==2){
            egFoundry egFoundry = Foundryitem.getscreenFoundry(new egFoundrySCREEN2());
            return egFoundry.getFoundryName();
        }
        else{
            return "输入有误,选择代工厂失败";
        }
    }

    @Override
    public String Blueprint(int x,int y,String technology) {
        //开始选择screen蓝图
        bluePrintdata b = new bluePrintdemo(x,y,encryForblueprint.getdata(technology),new egbluePrintscreen());

        return b.draw();
    }
//
    @Override
    public String Frameworks(int i) {
        Context context;
        if (i==1){
            context = new Context(new Program1());
            return context.exeCuteStrate();
        }
        else if (i==2){
            context = new Context(new Program2());
            return context.exeCuteStrate();
        }
        else if (i==3){
            context = new Context(new Program3());
            return context.exeCuteStrate();
        }
        else{
            return "添加失败";
        }
    }

    @Override
    public String Production() {
        MakeFactory makeFactory = new MakeFactory();
        Makesth makescreen = makeFactory.getMake(new Makescreen());

        return makescreen.making();
    }
}
